from . import views
from django.views.generic import RedirectView

from django.urls import re_path as url
from django.contrib import admin
from django.urls import path

app_name = 'app2_name'  # 关键是这行，这样对不同app下相同名称的url就可以进行区分了。{% url 'app1:inserpath' %}

system_config_upload = views.InputSourceViewSet.as_view(
    {
        'post': 'create',
        # 'get' : 'directory_tree_view'
    })

videopath = views.videoPathViewSet.as_view(
    {
        'post': 'create',
        'get' : 'list'
    })

imagepath = views.imagePathViewSet.as_view(
    {
        'post': 'create',
        'get' : 'list'
    })

# video_upload = views.VideoViewSet.as_view(
#     {
#         'post': 'create',
#         'get' : 'list',
#         'delete': 'destroy'InputSourceType
#     })

urlpatterns = [
    # 重定向
    path('inputsource/', system_config_upload),
    path('setvideopath/', videopath, name='videopath'),
    path('setimagepath/', imagepath, name='imagepath'),
    path('getvideopath/', videopath, name='getvideopath'),
    path('getimagepath/', imagepath, name='getimagepath'),

    # path('uploadvideo/', video_upload),
    # path('downloadimage/', download_image, name='download_image'),
    # path('downloadvideo/', download_video, name='download_video'),
]